<template>
	<view class="list">
		<view class="list_item" v-for="(item,index) in dataList" :key="index" @click="goDetail(item)">
			<view class="img">
				<view>
					<view>
						<text class="sign">￥</text>
						<text class="num">{{item.price || 0}}</text>
					</view>
					<view class="tip">
						满{{item.full_reduce || 0}}可用
					</view>
				</view>
			</view>
			<view class="cont">
				<view class="name u-line-2">{{item.name}}</view>
				<view class="sub_title u-line-2">{{item.remark || ''}}</view>
				<view class="time">{{item.start_effective | formatTime()}}-{{item.end_effective | formatTime()}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		formatDate
	} from '@/utils/moment/index.js';
	export default {
		props: {
			parameter: {
				type: Object,
				default: () => {
					return {};
				}
			},
			dataList: {
				type: Array,
				default: []
			}
		},
		filters: {
			formatTime(val) {
				return formatDate(val, 'YYYY-MM-DD');
			}
		},
		data() {
			return {};
		},
		mounted() {},
		methods: {
			goDetail(item) {
				if(item.fk_class_id == 6 && item.fk_pro_id){
					this.$linkTo(`/package/index/shopDetail/index?id=${item.fk_pro_id}`)
				}
			}
		},
	};
</script>

<style scoped lang="scss">
	.list {
		padding: 40rpx 26rpx;

		.list_item {
			margin-bottom: 30rpx;
			background: #FFFFFF;
			border-radius: 10rpx;
			display: flex;

			.img {
				margin-right: 24rpx;
				background-image: url(../../../../static/coupon.png);
				width: 220rpx;
				height: 190rpx;
				background-size: 100% 100%;
				color: #fff;
				display: flex;
				align-items: center;
				justify-content: center;

				.sign {
					font-size: 30rpx;
				}

				.num {
					font-size: 56rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #FFFFFF;
				}

				.tip {
					font-size: 28rpx;
					margin-top: 16rpx;
				}
			}

			.cont {
				flex: 1;
				overflow: hidden;

				.name {
					margin-top: 24rpx;
					font-size: 30rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #000000;
				}

				.sub_title {
					font-size: 24rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					margin-top: 12rpx;
					color: #999999;
				}

				.time {
					margin-top: 10rpx;
					font-size: 24rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #999999;
				}
			}
		}
	}
</style>
